package com.wkbb.sports.utils;

import com.wkbb.sports.dto.TrainStudentSummaryDto;

public class StatisticsStudent {
	
	private int maleFine = 0, maleGood = 0, malePass = 0, maleFail = 0;
	
	private int femaleFine = 0, femaleGood = 0, femalePass = 0, femaleFail = 0;

	public void calculateLevel(byte sex, double score) {
		if(sex == 1) {
			if(score >= 90) {
				maleFine++;
			}else if(score >= 80) {
				maleGood++;
			}else if(score >= 60) {
				malePass++;
			}else {
				maleFail++;
			}
			
		}else {
			
			if(score >= 90) {
				femaleFine++;
			}else if(score >= 80) {
				femaleGood++;
			}else if(score >= 60) {
				femalePass++;
			}else {
				femaleFail++;
			}
			
		}
	}
	
	public void bindStudentSummary(TrainStudentSummaryDto dto) {
		dto.setMaleFine(maleFine);
		dto.setMaleGood(maleGood);
		dto.setMalePass(malePass);
		dto.setMaleFail(maleFail);
		
		dto.setFemaleFine(femaleFine);
		dto.setFemaleGood(femaleGood);
		dto.setFemalePass(femalePass);
		dto.setFemaleFail(femaleFail);
	}

}
